<?php
declare(strict_types=1);
namespace App\Controller\Api\V1\Common;

use App\Controller\Api\BaseController;
use App\Factory\SmsFactory;
use App\Request\SmsCodeSendRequest;
use Hyperf\Di\Annotation\Inject;

class SmsController extends BaseController
{
    /**
     * @Inject
     * @var SmsFactory
     */
    private $sms_service;
    /**
     * @param SmsCodeSendRequest $request
     */
    public function send(SmsCodeSendRequest $request){
        $data = $request->all();
        $return = $this->sms_service->send($data);
        if($return['success']){
            return $this->response->success([]);
        }
        return $this->response->error(10012,$return['msg']);
    }
}